//
//  UIView+Shadow.h
//  mobile
//
//  Created by abc on 2019/1/14.
//  Copyright © 2019 azazie. All rights reserved.
//

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

@interface UIView (Shadow)

/**
 @param shadowOpacity 透明度
 @param shadowRadius 阴影半径
 @param cornerRadius 圆角半径
 */

- (CALayer *)addShadowWithOpacity:(float)shadowOpacity
                     shadowRadius:(CGFloat)shadowRadius
                  andCornerRadius:(CGFloat)cornerRadius;

- (CALayer *)addShadowWithOpacity:(float)shadowOpacity
                     shadowRadius:(CGFloat)shadowRadius
                  andCornerRadius:(CGFloat)cornerRadius
                       identifier:(NSString *)identifier;

- (void)removeShadow;

- (void)setBorderColor:(UIColor *)borderColor width:(CGFloat)borderWidth;

- (void)removeBorder;

#pragma mark - 设置部分圆角

/**
 *  设置部分圆角(绝对布局)
 *
 *  @param corners 需要设置为圆角的角 UIRectCornerTopLeft | UIRectCornerTopRight | UIRectCornerBottomLeft | UIRectCornerBottomRight | UIRectCornerAllCorners
 *  @param radii   需要设置的圆角大小 例如 CGSizeMake(20.0f, 20.0f)
 */
- (void)addRoundedCorners:(UIRectCorner)corners
                withRadii:(CGSize)radii;
/**
 *  设置部分圆角(相对布局)
 *
 *  @param corners 需要设置为圆角的角 UIRectCornerTopLeft | UIRectCornerTopRight | UIRectCornerBottomLeft | UIRectCornerBottomRight | UIRectCornerAllCorners
 *  @param radii   需要设置的圆角大小 例如 CGSizeMake(20.0f, 20.0f)
 *  @param rect    需要设置的圆角view的rect
 */
- (void)addRoundedCorners:(UIRectCorner)corners
                withRadii:(CGSize)radii
                 viewRect:(CGRect)rect;

@end

NS_ASSUME_NONNULL_END
